package com.canlihao.ui.view.activity;

import android.os.Bundle;
import android.view.View;
import android.widget.Button;

import com.alibaba.android.arouter.launcher.ARouter;
import com.canlihao.ui.R;
import com.canlihao.ui.base.BaseWhiteTopbarActivity;
import com.canlihao.ui.utils.UpdateDialog;
import com.canlihao.ui.view.fragment.UpdateDialogFragment;

import butterknife.BindView;
import butterknife.ButterKnife;

/*******
 *
 *Created by panda李
 *
 *创建时间 2020/2/10
 *
 *类描述：
 *
 ********/
public class LoadingActivity extends BaseWhiteTopbarActivity {
    @BindView(R.id.btn_loading)
    Button btnLoading;
    @Override
    public int getLayoutResId() {
        return R.layout.loading_activity;
    }

    @Override
    protected void initView() {
        super.initView();
        mTopBar.setTitle("loading");
    }

    @Override
    public void initData() {
        super.initData();
//        updateDialog = new UpdateDialog(LoadingActivity.this,"1、这是一个测试的点击弹出更新提示；",
//                "http://cnalihao.oss-cn-chengdu.aliyuncs.com/app/sansongtv_lastest.apk","0");
        //https://static.ss-clouddoctor.com/app/sansongtv_lastest.apk
        btnLoading.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                //updateDialog.show();
                UpdateDialogFragment updateDialogFragment = (UpdateDialogFragment) ARouter.getInstance().build("/app/case_update")
                        .withString("content", "1、这是一个测试的点击弹出更新提示；")
                        .withString("force", String.valueOf(0))
                        .withString("url", "http://cnalihao.oss-cn-chengdu.aliyuncs.com/app/li_lastest.apk")
                        .navigation();
                updateDialogFragment.show(getSupportFragmentManager(), "/app/case_update");
            }
        });
    }

}
